
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>结束 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-atoc/atoc.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="../chapter3/myinfo/我的信息.html" />
    

    <link href="http://wiki.7zxjz.com/rss" title="GitBook 使用教程" rel="alternate" type="application/rss+xml" />

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简单介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../项目结构.html">
            
                <a href="../项目结构.html">
            
                    
                    项目结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../product/">
            
                <a href="../product/">
            
                    
                    产品需求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter1/">
            
                <a href="../chapter1/">
            
                    
                    下拉选择、分类说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter2/">
            
                <a href="../chapter2/">
            
                    
                    UI标准说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter3/">
            
                <a href="../chapter3/">
            
                    
                    页面逻辑说明
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter3/section1.html">
            
                <a href="../chapter3/section1.html">
            
                    
                    首页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter3/section2.html">
            
                <a href="../chapter3/section2.html">
            
                    
                    工作台(个人独有)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter3/section3.html">
            
                <a href="../chapter3/section3.html">
            
                    
                    信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter3/section4.html">
            
                <a href="../chapter3/section4.html">
            
                    
                    发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../chapter3/section5.html">
            
                <a href="../chapter3/section5.html">
            
                    
                    我的
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.5.1" data-path="../chapter3/myinfo/我的信息.html">
            
                <a href="../chapter3/myinfo/我的信息.html">
            
                    
                    我的信息
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.7" data-path="./">
            
                <a href="./">
            
                    
                    结束
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >结束</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><span class="title-icon "></span><a href="#&#x7ED3;&#x675F;"><b>1. </b>&#x7ED3;&#x675F;</a></li></ul></div><a href="#&#x7ED3;&#x675F;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x7ED3;&#x675F;"><a name="&#x7ED3;&#x675F;" class="anchor-navigation-ex-anchor" href="#&#x7ED3;&#x675F;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x7ED3;&#x675F;</h1>
<ul>
<li><a href="https://gitbook.zhangjikai.com/plugins.html#splitter" target="_blank">https://gitbook.zhangjikai.com/plugins.html#splitter</a></li>
<li><a href="http://www.css88.com/archives/6622" target="_blank">http://www.css88.com/archives/6622</a></li>
<li><a href="https://ymcatar.gitbooks.io/gitbook-test/content/testing_mcqx.html" target="_blank">https://ymcatar.gitbooks.io/gitbook-test/content/testing_mcqx.html</a></li>
<li><a href="https://www.cnblogs.com/yangykaifa/p/6707728.html" target="_blank">gitbook&#x7684;&#x4F7F;&#x7528;</a></li>
<li><a href="https://ds.mockplus.cn/lib" target="_blank">&#x8BBE;&#x8BA1;&#x89C4;&#x8303;</a></li>
</ul>
<h3 id="&#x77E5;&#x884C;&#x76F8;&#x5173;&#x5F00;&#x53D1;&#x8D44;&#x6599;"><a name="&#x77E5;&#x884C;&#x76F8;&#x5173;&#x5F00;&#x53D1;&#x8D44;&#x6599;" class="anchor-navigation-ex-anchor" href="#&#x77E5;&#x884C;&#x76F8;&#x5173;&#x5F00;&#x53D1;&#x8D44;&#x6599;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x77E5;&#x884C;&#x76F8;&#x5173;&#x5F00;&#x53D1;&#x8D44;&#x6599;</h3>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> createError = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;http-errors&apos;</span>);
<span class="hljs-keyword">var</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;express&apos;</span>);
<span class="hljs-keyword">var</span> path = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;path&apos;</span>);
<span class="hljs-keyword">var</span> cookieParser = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;cookie-parser&apos;</span>);
<span class="hljs-keyword">var</span> logger = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;morgan&apos;</span>);
<span class="hljs-keyword">var</span> sha1 = <span class="hljs-built_in">require</span>(<span class="hljs-string">&quot;sha1&quot;</span>);
<span class="hljs-keyword">var</span> indexRouter = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;./routes/index&apos;</span>);
<span class="hljs-keyword">var</span> usersRouter = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;./routes/users&apos;</span>);

<span class="hljs-keyword">var</span> app = express();



<span class="hljs-comment">// view engine setup</span>
app.set(<span class="hljs-string">&apos;views&apos;</span>, path.join(__dirname, <span class="hljs-string">&apos;views&apos;</span>));
app.set(<span class="hljs-string">&apos;view engine&apos;</span>, <span class="hljs-string">&apos;pug&apos;</span>);

app.use(logger(<span class="hljs-string">&apos;dev&apos;</span>));
app.use(express.json());
app.use(express.urlencoded({ extended: <span class="hljs-literal">false</span> }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, <span class="hljs-string">&apos;public&apos;</span>)));

app.use(<span class="hljs-string">&apos;/&apos;</span>, indexRouter);
app.use(<span class="hljs-string">&apos;/users&apos;</span>, usersRouter);
<span class="hljs-keyword">var</span> config = {
    <span class="hljs-string">&quot;appID&quot;</span>: <span class="hljs-string">&quot;wx838cf54dd030d93a&quot;</span>,
    <span class="hljs-string">&quot;appsecret&quot;</span>: <span class="hljs-string">&quot;8a0041073ad34bbe65c68908f8f6becb&quot;</span>,
    <span class="hljs-string">&quot;token&quot;</span>: <span class="hljs-string">&quot;zhixing_wechat&quot;</span>
}

app.use(<span class="hljs-string">&apos;/wechat&apos;</span>,<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">req,res,next</span>) </span>{
    <span class="hljs-comment">// &#x83B7;&#x53D6;&#x5FAE;&#x4FE1;&#x670D;&#x52A1;&#x5668;&#x53D1;&#x9001;&#x7684;&#x6570;&#x636E;</span>
    <span class="hljs-keyword">var</span> signature = req.query.signature,
        timestamp = req.query.timestamp,
        nonce = req.query.nonce,
        echostr = req.query.echostr;

    <span class="hljs-comment">// token&#x3001;timestamp&#x3001;nonce&#x4E09;&#x4E2A;&#x53C2;&#x6570;&#x8FDB;&#x884C;&#x5B57;&#x5178;&#x5E8F;&#x6392;&#x5E8F;</span>
    <span class="hljs-keyword">var</span> arr = [config.token, timestamp, nonce].sort().join(<span class="hljs-string">&apos;&apos;</span>);
    <span class="hljs-comment">// sha1&#x52A0;&#x5BC6;</span>
    <span class="hljs-keyword">var</span> result = sha1(arr);

    <span class="hljs-keyword">if</span>(result === signature){
        res.send(echostr);
    }<span class="hljs-keyword">else</span>{
        res.send(<span class="hljs-string">&apos;mismatch&apos;</span>);
    }
})

<span class="hljs-comment">// catch 404 and forward to error handler</span>
app.use(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">req, res, next</span>) </span>{
  next(createError(<span class="hljs-number">404</span>));
});

<span class="hljs-comment">// error handler</span>
app.use(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">err, req, res, next</span>) </span>{
  <span class="hljs-comment">// set locals, only providing error in development</span>
  res.locals.message = err.message;
  res.locals.error = req.app.get(<span class="hljs-string">&apos;env&apos;</span>) === <span class="hljs-string">&apos;development&apos;</span> ? err : {};

  <span class="hljs-comment">// render the error page</span>
  res.status(err.status || <span class="hljs-number">500</span>);
  res.render(<span class="hljs-string">&apos;error&apos;</span>);
});

<span class="hljs-built_in">module</span>.exports = app;
</code></pre>
<p>Info styling</p>
<blockquote>
<p><strong>[info] For info</strong></p>
<p>Use this for infomation messages.</p>
</blockquote>
<p>Warning styling</p>
<blockquote>
<p><strong>[warning] For warning</strong></p>
<p>Use this for warning messages.</p>
</blockquote>
<p>Danger styling</p>
<blockquote>
<p><strong>[danger] For danger</strong></p>
<p>Use this for danger messages.</p>
</blockquote>
<p>Success styling</p>
<blockquote>
<p><strong>[success] For info</strong></p>
<p>Use this for success messages.</p>
</blockquote>
<pre><code>**[terminal]
**[prompt foo@joe]**[path ~]**[delimiter  $ ]**[command ./myscript]
Normal output line. Nothing special here...
But...
You can add some colors. What about a warning message?
**[warning [WARNING] The color depends on the theme. Could look normal too]
What about an error message?
**[error [ERROR] This is not the error you are looking for]
</code></pre><footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x65E0;&#x53CC; 2017 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-08-10 19:35:51
</span></footer>


<script type="text/javascript">var className='atoc';</script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../chapter3/myinfo/我的信息.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 我的信息">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"结束","level":"1.7","depth":1,"previous":{"title":"我的信息","level":"1.6.5.1","depth":3,"path":"chapter3/myinfo/我的信息.md","ref":"chapter3/myinfo/我的信息.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","search-plus","tbfed-pagefooter","expandable-chapters-small","emphasize","anchor-navigation-ex","edit-link","todo","terminal","emphasize","splitter","rss","mermaid","jsfiddle","jsbin","atoc","alerts","sectionx","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 无双 2017","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"emphasize":{},"livereload":{},"jsfiddle":{"type":"script","tabs":["result","js","css","html"],"height":"500","width":"500","fontColor":"00FF00"},"todo":{},"atoc":{"addClass":true,"className":"atoc"},"splitter":{},"mermaid":{},"fontsettings":{"theme":"white","family":"sans","size":2},"rss":{"categories":["gitbook"],"title":"GitBook 使用教程","description":"记录 GitBook 的配置和一些插件的使用","author":"Jikai Zhang","feed_url":"http://wiki.7zxjz.com/rss","site_url":"http://wiki.7zxjz.com/","managingEditor":"matchless5233@gmail.com","webMaster":"matchless5233@gmail.com"},"sectionx":{"tag":"b"},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showLevel":true},"alerts":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"edit-link":{"label":"编辑此页面","base":"https://gitee.com/DongFangWuShuang/sf/blob/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"jsbin":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"language":"zh-hans","links":{"sidebar":{}},"gitbook":"*"},"file":{"path":"end/README.md","mtime":"2018-08-10T11:35:51.492Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-08-13T17:54:32.486Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-rss/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-jsfiddle/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-jsbin/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-atoc/atoc.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

